This application relates generally to processor-based systems, and, more particularly, to supporting denormal numbers in a processor-based system.
Processor-based systems such as central processing units (CPUs), graphics processing units (GPUs), or accelerated processing units (APUs) represent floating-point numbers using strings of bits. For example, a floating-point number can be represented using a signed digit string of a given length in a given base (or radix). The digit string is referred to as the significand, coefficient, or the mantissa. The length of the significand determines the precision of the floating-point number representation. The radix point position is assumed to be somewhere within the significand—often just after or just before the most significant digit or to the right of the rightmost (least significant) digit. The floating-point representation also includes a signed integer exponent, which may also be referred to as the characteristic or scale of the floating point number. The exponent modifies the magnitude of the number. To derive the value of the floating point number, the significand is multiplied by the base raised to the power of the exponent, which is equivalent to shifting the radix point from its implied position by a number of places equal to the value of the exponent—to the right if the exponent is positive or to the left if the exponent is negative.
The IEEE 754 binary point standard defines a set of normalized numbers using the format:X=(−1)Xs*1·Xf*2Xe−bias where X is the value of the normalized number, Xs is the sign bit, Xf is the fractional part of the significand or mantissa, Xe is the exponent, and bias is the bias of the format. Depending on the format of the number, the bias may be set to values such as 127, 1023, or 16,383.
Normalized floating-point numbers cannot be used to represent numbers in the range from just below ±2−bias+1 to zero. Numbers in this range are referred to as denormalized numbers and they can be represented using a sign bit and mantissa bits. For example, the IEEE 754 binary point standard defines a set of denormalized numbers using the format:X=(−1)Xs*0·Xf*21−bias, Xe=0, Xf≠0The denormal format differs from a normal number because the implied bit is “0” and the exponent is forced up by 1 to a value of Emin, which is equal to −126, −1022, or −16,382, depending on the format.